<?php
/*
Module:		main
Version:	20071128a-DAT
File:		run.php
*/
	/* NICK */
	if (strtoupper($args[0]) == "!NICK"){
		if (count($args) < 3)
		cmd_send(prep_text("Nick", "Syntax: !nick admin_pass new_nick"));
		else
		{
			if ($args[1] == $CONFIG['admin_pass'])
			cmd_send("NICK ". $args[2]);
			else
			cmd_send(prep_text("Nick", "Invalid password"));
		}
	}// Nick
	
if(strtoupper($args[0]) == '!JOIN')
{//!join
	if(strlen($args[1])>2)
	{
	 	cmd_send("JOIN ".$args[1]);
	 	cmd_send(prep_text2($con['buffer']['username'].' hat mir diesen Chan empfohlen...',$args[1]));
	}else
	{
		 cmd_send(prep_text('denied','nice try asshole'));
	}
     
}//!join
	
	if(strtoupper($args[0]) == '!CTCP_VER')
	{//!ver
		if (count($args) >= 2)  cmd_send("PRIVMSG ".$args[1]." :\001VERSION\001");
		if (count($args) < 2)  cmd_send("PRIVMSG ".$con['buffer']['username']." :\001VERSION\001");
	}//!ver
	
	if(strtoupper($args[0]) == '!VERSION')
	{//!ver
		cmd_send(prep_text('Free-Chao Version',$CONFIG['version']));
	}//!ver
	


	
	
	
	if($CONFIG['admin_nick']==$con['buffer']['username'])
	{//ADMINCOMMANDS
  if(strtoupper($args[0]) == '!hop')
  {//!hop
 		 cmd_send("PART ".$con['buffer']['channel']);
 		 cmd_send("JOIN ".$con['buffer']['channel']);
	}//!hop

    if(strtoupper($args[0]) == '!MODE')
    {
     cmd_send("MODE ".implode(array_slice($args,1),' '));
    }
  	if(strtoupper($args[0]) == '!LEAVE')
    {//!leave
      cmd_send("PART ".$con['buffer']['channel']);
  	}//!leave
  	if(strtoupper($args[0]) == '!QUIT')
    {//!leave
      cmd_send("QUIT :".$CONFIG['quit_msg']);
  	}//!leave
  	if(strtoupper($args[0]) == '!KICK')
    {//!kick
     IF (count($args) >= 3) cmd_send("KICK ".$con['buffer']['channel'].' '.$args[1].' :'.implode(array_slice($args,2),' '));
		 if (count($args) < 3)  cmd_send("KICK ".$con['buffer']['channel'].' '.$args[1].' :'.$CONFIG['default_kick_msg']);
  	}//!kick
  	  if(strtoupper($args[0]) == '!hop')
    {//!join
 	  	 cmd_send("PART ".$con['buffer']['channel']);
 	  	 cmd_send("JOIN ".$con['buffer']['channel']);
	  }//!join
  }//ADMINCOMMANDS

//register commands 
if(strtoupper($args[0]) == "!COMMANDS")
{
	$COMMANDS=$COMMANDS.", !JOIN, !CTCP_VER, !VERSION";
}
	
	

?>
